package com.fau.cm.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 员工任务统计表实体类
 * @author kangyj
 * @datetime 2014年12月10日,上午11:07:34
 */
@Entity
@Table(name = "medical_call_task_statistics")
public class MedicalCallTaskStatistics implements Serializable, JSONAware {

	private static final long serialVersionUID = 5257080770460044240L;

	private String id;				
	private String handleUserId;	// 处里者id
	private String handUserName;	// 任务处理者姓名
	private String taskType;		// 任务类型
	private String taskId;			// 任务id
	private String hospitalId;		// 医院id
	private Date taskTime;			// 任务时间
	private String startTime;		// 开始时间
	private String endTime;			// 结束时间
	
	private Integer untreatedCount;	// 未处理任务数
	private Integer pendingCount;	// 待处理任务数
	private Integer endCount;		// 已结束任务数
	private Integer totalCount;		// 总任务数
	
	private Date stime;
	private Date etime;
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "handle_user_id", length = 32)
	public String getHandleUserId() {
		return handleUserId;
	}

	public void setHandleUserId(String handleUserId) {
		this.handleUserId = handleUserId;
	}
	
	@Transient
	public String getHandUserName() {
		return handUserName;
	}

	public void setHandUserName(String handUserName) {
		this.handUserName = handUserName;
	}

	@Column(name = "task_type", length = 5)
	public String getTaskType() {
		return taskType;
	}

	public void setTaskType(String taskType) {
		this.taskType = taskType;
	}

	@Column(name = "task_id", length = 32)
	public String getTaskId() {
		return taskId;
	}

	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	
	@Column(name = "hospital_id", length = 32)
	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}
	
	@Column(name = "task_time")
	public Date getTaskTime() {
		return taskTime;
	}

	public void setTaskTime(Date taskTime) {
		this.taskTime = taskTime;
	}
	
	@Transient
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	@Transient
	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	@Transient
	public Integer getUntreatedCount() {
		return untreatedCount;
	}

	public void setUntreatedCount(Integer untreatedCount) {
		this.untreatedCount = untreatedCount;
	}

	@Transient
	public Integer getPendingCount() {
		return pendingCount;
	}

	public void setPendingCount(Integer pendingCount) {
		this.pendingCount = pendingCount;
	}

	@Transient
	public Integer getEndCount() {
		return endCount;
	}

	public void setEndCount(Integer endCount) {
		this.endCount = endCount;
	}
	
	@Transient
	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	
	@Transient
	public Date getStime() {
		return stime;
	}

	public void setStime(Date stime) {
		this.stime = stime;
	}

	@Transient
	public Date getEtime() {
		return etime;
	}

	public void setEtime(Date etime) {
		this.etime = etime;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("handUserName", handUserName);
		obj.put("untreatedCount", untreatedCount);
		obj.put("pendingCount", pendingCount);
		obj.put("endCount", endCount);
		obj.put("totalCount", totalCount);
		return obj.toString();
	}

}
